Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Streaming Serializer [WIP][Concept] #90

Open
wants to merge 5 commits into
base: feature/next
Choose a base branch
from

Conversation

IljaN
Copy link
Member

@IljaN IljaN commented Jul 29, 2019

Description

Modifies serializer to encode from streams. The basic idea is to use generators to lazily stream all objects trough the export or import chain thus reducing memory usage.

Related Issue

#89

Motivation and Context

  • We should replace the symfony Filesystem-class with @jvillafanez's Filesystem class (Export/Import Versions #39) , which also allows opening streams and is more testable.
  • It is the responsibility of the consumer to manage (close/open) streams passed to the serializer.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@IljaN IljaN changed the base branch from master to feature/next July 29, 2019 08:53
*/
public function deserialize($data, $type) {
return $this->serializer->deserialize($data, $type, 'json', []);
private function readLines($stream, $lineBufSize = 256) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method might not be needed as streams should be lazy by default

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants